﻿using System;
using System.Collections.Generic;
using ProductFeedbackE = JTLeigh.Commerce.Spencer.Features.ProductFeedback.Common.Entities.ProductFeedback;

namespace JTLeigh.Commerce.Spencer.Features.ProductFeedback.Business.Caches
{

	/// <summary>
	/// Cache used to store product feedback.
	/// </summary>
	public interface IProductFeedbackCache
	{

		#region Methods

		/// <summary>
		/// Gets the product feedback for the specified product from the cache.
		/// </summary>
		/// <param name="tenantId">The tenant identifier <see cref="Guid"/> of the tenant whose 
		/// product feedback is to be retrieved.</param>
        /// <param name="catalogId">The catalog identifier <see cref="String"/> of the catalog
        /// that the product whose product feedbck is to be retrieved is in.</param>
        /// <param name="productId">The product identifier <see cref="String"/> of the product 
		/// whose product feedbck is to be retrieved.</param>
		/// <returns>The <see cref="Dictionary{TKey,TValue}"/> of <see cref="ProductFeedback"/> 
		/// objects for the product from the cache, or <see langword="null" /> if feedback for the
		/// product has not been cached.</returns>
		Dictionary<Guid, ProductFeedbackE> GetProductFeedback(Guid tenantId, string catalogId, string productId);

		/// <summary>
		/// Sets the product feedback for the specified product in the cache.
		/// </summary>
		/// <param name="tenantId">The tenant identifier <see cref="Guid"/> of the tenant whose 
		/// product feedback is to be stored.</param>
        /// <param name="catalogId">The catalog identifier <see cref="String"/> of the catalog
        /// whose product feedback is to be stored.</param>
        /// <param name="productId">The product identifier <see cref="String"/> of the product 
		/// whose product feedback is to be stored.</param>
		/// <param name="feedback">The <see cref="Dictionary{TKey,TValue}"/> of 
		/// <see cref="ProductFeedback"/> objects to store.</param>
		void SetProductFeedback(Guid tenantId, string catalogId, string productId, Dictionary<Guid, ProductFeedbackE> feedback);

		#endregion // Methods

	}

}
